package org.crazyit.cloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController {
	
	@Autowired
	private SendService sendService;
	
	@RequestMapping(value="/send",method=RequestMethod.GET)
	public String send() {
		Message msg = MessageBuilder.withPayload("Hello World".getBytes()).build();
		sendService.sendOrder().send(msg);
		return "success";
	}
	
//	@RequestMapping(value="/call/{id}",method=RequestMethod.GET,
//			produces=MediaType.APPLICATION_JSON_VALUE)
//	public Police call(@PathVariable Integer id) {
//		Police p = new Police();
//		p.setId(id);
//		p.setName("angus");
//		return p;
//	}
	
}
